package com.gomro.galaxy.foundation.bi.controller;

import com.gomro.galaxy.core.commons.model.Result;
import com.gomro.galaxy.core.commons.response.RestResponse;
import com.gomro.galaxy.foundation.bi.api.CustomerTradeApi;
import com.gomro.galaxy.foundation.bi.api.SalesDataComparisonStaticsApi;
import com.gomro.galaxy.foundation.bi.domain.model.analysis.CustomerTradeVolume;
import com.gomro.galaxy.foundation.bi.domain.model.analysis.SalesDataComparisonStatisticsVolume;
import com.gomro.galaxy.foundation.bi.domain.model.analysis.SalesDataComparisonStatisticsVolumeView;
import com.gomro.galaxy.foundation.bi.query.CustomerTradeQuery;
import com.gomro.galaxy.foundation.bi.query.SalesDataComparisonStaticsQuery;
import com.gomro.galaxy.foundation.bi.service.CustomerTradeService;
import com.gomro.galaxy.foundation.bi.service.SalesDataComparisonStaticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客户交易记录controller
 *
 * @author ZhangLei
 */
@Slf4j
@RestController
@RequestMapping("sales/data")
public class SalesDataComparisonStaticsController implements SalesDataComparisonStaticsApi {
    private final SalesDataComparisonStaticsService service;

    public SalesDataComparisonStaticsController(SalesDataComparisonStaticsService service) {
        this.service = service;
    }

    /**
     * 客户交易数据分页查询
     *
     * @param query
     * @return
     */
    @Override
    public RestResponse<List<SalesDataComparisonStatisticsVolumeView>> page(SalesDataComparisonStaticsQuery query) {
        return service.page(query);
    }
}
